package com.cn.web.org.vo;

import cn.hutool.extra.pinyin.PinyinUtil;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * description: UnitTreeVO <br>
 * date: 22.4.22 10:18 <br>
 * author: cn_yaojin <br>
 * version: 1.0 <br>
 */
@Setter
@Getter
@Accessors(chain = true)
@ApiModel(value = "部门、用户")
public class UnitTreeVO {

    @ApiModelProperty(value = "id")
    private String id;

    @ApiModelProperty(value = "名称")
    private String name;

    @ApiModelProperty(value = "英文名称")
    private String enName;

    @ApiModelProperty(value = "1-部门 2-人员")
    private String type;

    @ApiModelProperty(value = "子节点")
    private List<UnitTreeVO> child;

    @JsonIgnore
    @ApiModelProperty(value = "该属性针对人员类型，后端遍历筛选数据使用", hidden = true)
    private String unitId;

    public String getEnName() {
        return PinyinUtil.getPinyin(name, "");
    }

}
